﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using StructureMap.Configuration.DSL;
using Core.IServices;
using Services;
using StructureMap.Pipeline;
using System.Configuration;
using Core.Domain;
using Core.Dtos;
using Core.Aspects;
using StructureMap.Building.Interception;
using Core.Factories;
using Core.Context;
using Core.Presentation;
using StructureMap;

namespace DI
{
    public class AppContextRegistry : Registry
    {
        public AppContextRegistry(ILifecycle lifecycle)
        {
            For<IAppSettings>().LifecycleIs(lifecycle).Use(ctx => ctx.GetInstance<ISettingsFactory>().GetInstance());
            For<IAppContext>().LifecycleIs(lifecycle).Use(ctx => ctx.GetInstance<IAppContextFactory>().GetInstance());
            For<ICurrentContext>().LifecycleIs(lifecycle).Use(new CurrentContext());
        }
    }
}
